package com.facebook.imagepipeline.core;

import android.app.ActivityManager;
import android.content.Context;
import android.graphics.Bitmap.Config;
import com.facebook.cache.disk.DiskCacheConfig;
import com.facebook.cache.disk.DiskCacheConfig.Builder;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.internal.Supplier;
import com.facebook.common.memory.MemoryTrimmableRegistry;
import com.facebook.common.memory.NoOpMemoryTrimmableRegistry;
import com.facebook.imagepipeline.animated.factory.AnimatedImageFactory;
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory;
import com.facebook.imagepipeline.cache.CacheKeyFactory;
import com.facebook.imagepipeline.cache.DefaultBitmapMemoryCacheParamsSupplier;
import com.facebook.imagepipeline.cache.DefaultCacheKeyFactory;
import com.facebook.imagepipeline.cache.DefaultEncodedMemoryCacheParamsSupplier;
import com.facebook.imagepipeline.cache.ImageCacheStatsTracker;
import com.facebook.imagepipeline.cache.MemoryCacheParams;
import com.facebook.imagepipeline.cache.NoOpImageCacheStatsTracker;
import com.facebook.imagepipeline.decoder.ImageDecoder;
import com.facebook.imagepipeline.decoder.ProgressiveJpegConfig;
import com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig;
import com.facebook.imagepipeline.listener.RequestListener;
import com.facebook.imagepipeline.memory.PoolConfig;
import com.facebook.imagepipeline.memory.PoolConfig.Builder;
import com.facebook.imagepipeline.memory.PoolFactory;
import com.facebook.imagepipeline.producers.HttpUrlConnectionNetworkFetcher;
import com.facebook.imagepipeline.producers.NetworkFetcher;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nullable;

public class ImagePipelineConfig
{

  @Nullable
  private final AnimatedImageFactory mAnimatedImageFactory;
  private final Bitmap.Config mBitmapConfig;
  private final Supplier<MemoryCacheParams> mBitmapMemoryCacheParamsSupplier;
  private final CacheKeyFactory mCacheKeyFactory;
  private final Context mContext;
  private final boolean mDecodeMemoryFileEnabled;
  private final boolean mDownsampleEnabled;
  private final Supplier<MemoryCacheParams> mEncodedMemoryCacheParamsSupplier;
  private final ExecutorSupplier mExecutorSupplier;
  private final FileCacheFactory mFileCacheFactory;
  private final ImageCacheStatsTracker mImageCacheStatsTracker;

  @Nullable
  private final ImageDecoder mImageDecoder;
  private final ImagePipelineExperiments mImagePipelineExperiments;
  private final Supplier<Boolean> mIsPrefetchEnabledSupplier;
  private final DiskCacheConfig mMainDiskCacheConfig;
  private final MemoryTrimmableRegistry mMemoryTrimmableRegistry;
  private final NetworkFetcher mNetworkFetcher;

  @Nullable
  private final PlatformBitmapFactory mPlatformBitmapFactory;
  private final PoolFactory mPoolFactory;
  private final ProgressiveJpegConfig mProgressiveJpegConfig;
  private final Set<RequestListener> mRequestListeners;
  private final boolean mResizeAndRotateEnabledForNetwork;
  private final DiskCacheConfig mSmallImageDiskCacheConfig;

  private ImagePipelineConfig(Builder paramBuilder)
  {
    this.mAnimatedImageFactory = paramBuilder.mAnimatedImageFactory;
    Object localObject1;
    Bitmap.Config localConfig;
    label55: Object localObject2;
    label72: Object localObject3;
    label123: Object localObject4;
    label153: Object localObject5;
    label171: Object localObject6;
    label202: DiskCacheConfig localDiskCacheConfig1;
    label224: Object localObject7;
    label242: Object localObject8;
    label264: PoolFactory localPoolFactory;
    label300: Object localObject9;
    label322: Object localObject10;
    label344: DiskCacheConfig localDiskCacheConfig2;
    label371: int i;
    if (paramBuilder.mBitmapMemoryCacheParamsSupplier == null)
    {
      localObject1 = new DefaultBitmapMemoryCacheParamsSupplier((ActivityManager)paramBuilder.mContext.getSystemService("activity"));
      this.mBitmapMemoryCacheParamsSupplier = ((Supplier)localObject1);
      if (paramBuilder.mBitmapConfig != null)
        break label430;
      localConfig = Bitmap.Config.ARGB_8888;
      this.mBitmapConfig = localConfig;
      if (paramBuilder.mCacheKeyFactory != null)
        break label438;
      localObject2 = DefaultCacheKeyFactory.getInstance();
      this.mCacheKeyFactory = ((CacheKeyFactory)localObject2);
      this.mContext = ((Context)Preconditions.checkNotNull(paramBuilder.mContext));
      this.mDecodeMemoryFileEnabled = paramBuilder.mDecodeMemoryFileEnabled;
      if (paramBuilder.mFileCacheFactory != null)
        break label447;
      localObject3 = new DiskStorageCacheFactory(new DynamicDefaultDiskStorageFactory());
      this.mFileCacheFactory = ((FileCacheFactory)localObject3);
      this.mDownsampleEnabled = paramBuilder.mDownsampleEnabled;
      if (paramBuilder.mEncodedMemoryCacheParamsSupplier != null)
        break label456;
      localObject4 = new DefaultEncodedMemoryCacheParamsSupplier();
      this.mEncodedMemoryCacheParamsSupplier = ((Supplier)localObject4);
      if (paramBuilder.mImageCacheStatsTracker != null)
        break label465;
      localObject5 = NoOpImageCacheStatsTracker.getInstance();
      this.mImageCacheStatsTracker = ((ImageCacheStatsTracker)localObject5);
      this.mImageDecoder = paramBuilder.mImageDecoder;
      if (paramBuilder.mIsPrefetchEnabledSupplier != null)
        break label474;
      localObject6 = new Supplier()
      {
        public Boolean get()
        {
          return Boolean.valueOf(true);
        }
      };
      this.mIsPrefetchEnabledSupplier = ((Supplier)localObject6);
      if (paramBuilder.mMainDiskCacheConfig != null)
        break label483;
      localDiskCacheConfig1 = getDefaultMainDiskCacheConfig(paramBuilder.mContext);
      this.mMainDiskCacheConfig = localDiskCacheConfig1;
      if (paramBuilder.mMemoryTrimmableRegistry != null)
        break label492;
      localObject7 = NoOpMemoryTrimmableRegistry.getInstance();
      this.mMemoryTrimmableRegistry = ((MemoryTrimmableRegistry)localObject7);
      if (paramBuilder.mNetworkFetcher != null)
        break label501;
      localObject8 = new HttpUrlConnectionNetworkFetcher();
      this.mNetworkFetcher = ((NetworkFetcher)localObject8);
      this.mPlatformBitmapFactory = paramBuilder.mPlatformBitmapFactory;
      if (paramBuilder.mPoolFactory != null)
        break label510;
      localPoolFactory = new PoolFactory(PoolConfig.newBuilder().build());
      this.mPoolFactory = localPoolFactory;
      if (paramBuilder.mProgressiveJpegConfig != null)
        break label519;
      localObject9 = new SimpleProgressiveJpegConfig();
      this.mProgressiveJpegConfig = ((ProgressiveJpegConfig)localObject9);
      if (paramBuilder.mRequestListeners != null)
        break label528;
      localObject10 = new HashSet();
      this.mRequestListeners = ((Set)localObject10);
      this.mResizeAndRotateEnabledForNetwork = paramBuilder.mResizeAndRotateEnabledForNetwork;
      if (paramBuilder.mSmallImageDiskCacheConfig != null)
        break label537;
      localDiskCacheConfig2 = this.mMainDiskCacheConfig;
      this.mSmallImageDiskCacheConfig = localDiskCacheConfig2;
      i = this.mPoolFactory.getFlexByteArrayPoolMaxNumThreads();
      if (paramBuilder.mExecutorSupplier != null)
        break label546;
    }
    label519: label528: label537: label546: for (Object localObject11 = new DefaultExecutorSupplier(i); ; localObject11 = paramBuilder.mExecutorSupplier)
    {
      this.mExecutorSupplier = ((ExecutorSupplier)localObject11);
      this.mImagePipelineExperiments = paramBuilder.mExperimentsBuilder.build();
      return;
      localObject1 = paramBuilder.mBitmapMemoryCacheParamsSupplier;
      break;
      label430: localConfig = paramBuilder.mBitmapConfig;
      break label55;
      label438: localObject2 = paramBuilder.mCacheKeyFactory;
      break label72;
      label447: localObject3 = paramBuilder.mFileCacheFactory;
      break label123;
      label456: localObject4 = paramBuilder.mEncodedMemoryCacheParamsSupplier;
      break label153;
      label465: localObject5 = paramBuilder.mImageCacheStatsTracker;
      break label171;
      label474: localObject6 = paramBuilder.mIsPrefetchEnabledSupplier;
      break label202;
      label483: localDiskCacheConfig1 = paramBuilder.mMainDiskCacheConfig;
      break label224;
      label492: localObject7 = paramBuilder.mMemoryTrimmableRegistry;
      break label242;
      label501: localObject8 = paramBuilder.mNetworkFetcher;
      break label264;
      label510: localPoolFactory = paramBuilder.mPoolFactory;
      break label300;
      localObject9 = paramBuilder.mProgressiveJpegConfig;
      break label322;
      localObject10 = paramBuilder.mRequestListeners;
      break label344;
      localDiskCacheConfig2 = paramBuilder.mSmallImageDiskCacheConfig;
      break label371;
    }
  }

  private static DiskCacheConfig getDefaultMainDiskCacheConfig(Context paramContext)
  {
    return DiskCacheConfig.newBuilder(paramContext).build();
  }

  public static Builder newBuilder(Context paramContext)
  {
    return new Builder(paramContext, null);
  }

  @Nullable
  public AnimatedImageFactory getAnimatedImageFactory()
  {
    return this.mAnimatedImageFactory;
  }

  public Bitmap.Config getBitmapConfig()
  {
    return this.mBitmapConfig;
  }

  public Supplier<MemoryCacheParams> getBitmapMemoryCacheParamsSupplier()
  {
    return this.mBitmapMemoryCacheParamsSupplier;
  }

  public CacheKeyFactory getCacheKeyFactory()
  {
    return this.mCacheKeyFactory;
  }

  public Context getContext()
  {
    return this.mContext;
  }

  public Supplier<MemoryCacheParams> getEncodedMemoryCacheParamsSupplier()
  {
    return this.mEncodedMemoryCacheParamsSupplier;
  }

  public ExecutorSupplier getExecutorSupplier()
  {
    return this.mExecutorSupplier;
  }

  public ImagePipelineExperiments getExperiments()
  {
    return this.mImagePipelineExperiments;
  }

  public FileCacheFactory getFileCacheFactory()
  {
    return this.mFileCacheFactory;
  }

  @Deprecated
  public int getForceSmallCacheThresholdBytes()
  {
    return this.mImagePipelineExperiments.getForceSmallCacheThresholdBytes();
  }

  public ImageCacheStatsTracker getImageCacheStatsTracker()
  {
    return this.mImageCacheStatsTracker;
  }

  @Nullable
  public ImageDecoder getImageDecoder()
  {
    return this.mImageDecoder;
  }

  public Supplier<Boolean> getIsPrefetchEnabledSupplier()
  {
    return this.mIsPrefetchEnabledSupplier;
  }

  public DiskCacheConfig getMainDiskCacheConfig()
  {
    return this.mMainDiskCacheConfig;
  }

  public MemoryTrimmableRegistry getMemoryTrimmableRegistry()
  {
    return this.mMemoryTrimmableRegistry;
  }

  public NetworkFetcher getNetworkFetcher()
  {
    return this.mNetworkFetcher;
  }

  @Nullable
  public PlatformBitmapFactory getPlatformBitmapFactory()
  {
    return this.mPlatformBitmapFactory;
  }

  public PoolFactory getPoolFactory()
  {
    return this.mPoolFactory;
  }

  public ProgressiveJpegConfig getProgressiveJpegConfig()
  {
    return this.mProgressiveJpegConfig;
  }

  public Set<RequestListener> getRequestListeners()
  {
    return Collections.unmodifiableSet(this.mRequestListeners);
  }

  public DiskCacheConfig getSmallImageDiskCacheConfig()
  {
    return this.mSmallImageDiskCacheConfig;
  }

  public boolean isDecodeFileDescriptorEnabled()
  {
    return this.mImagePipelineExperiments.isDecodeFileDescriptorEnabled();
  }

  public boolean isDecodeMemoryFileEnabled()
  {
    return this.mDecodeMemoryFileEnabled;
  }

  public boolean isDownsampleEnabled()
  {
    return this.mDownsampleEnabled;
  }

  public boolean isResizeAndRotateEnabledForNetwork()
  {
    return this.mResizeAndRotateEnabledForNetwork;
  }

  public boolean isWebpSupportEnabled()
  {
    return this.mImagePipelineExperiments.isWebpSupportEnabled();
  }

  public static class Builder
  {
    private AnimatedImageFactory mAnimatedImageFactory;
    private Bitmap.Config mBitmapConfig;
    private Supplier<MemoryCacheParams> mBitmapMemoryCacheParamsSupplier;
    private CacheKeyFactory mCacheKeyFactory;
    private final Context mContext;
    private boolean mDecodeMemoryFileEnabled;
    private boolean mDownsampleEnabled = false;
    private Supplier<MemoryCacheParams> mEncodedMemoryCacheParamsSupplier;
    private ExecutorSupplier mExecutorSupplier;
    private final ImagePipelineExperiments.Builder mExperimentsBuilder = new ImagePipelineExperiments.Builder(this);
    private FileCacheFactory mFileCacheFactory;
    private ImageCacheStatsTracker mImageCacheStatsTracker;
    private ImageDecoder mImageDecoder;
    private Supplier<Boolean> mIsPrefetchEnabledSupplier;
    private DiskCacheConfig mMainDiskCacheConfig;
    private MemoryTrimmableRegistry mMemoryTrimmableRegistry;
    private NetworkFetcher mNetworkFetcher;
    private PlatformBitmapFactory mPlatformBitmapFactory;
    private PoolFactory mPoolFactory;
    private ProgressiveJpegConfig mProgressiveJpegConfig;
    private Set<RequestListener> mRequestListeners;
    private boolean mResizeAndRotateEnabledForNetwork = true;
    private DiskCacheConfig mSmallImageDiskCacheConfig;

    private Builder(Context paramContext)
    {
      this.mContext = ((Context)Preconditions.checkNotNull(paramContext));
    }

    public ImagePipelineConfig build()
    {
      return new ImagePipelineConfig(this, null);
    }

    public ImagePipelineExperiments.Builder experiment()
    {
      return this.mExperimentsBuilder;
    }

    public boolean isDownsampleEnabled()
    {
      return this.mDownsampleEnabled;
    }

    public Builder setAnimatedImageFactory(AnimatedImageFactory paramAnimatedImageFactory)
    {
      this.mAnimatedImageFactory = paramAnimatedImageFactory;
      return this;
    }

    public Builder setBitmapMemoryCacheParamsSupplier(Supplier<MemoryCacheParams> paramSupplier)
    {
      this.mBitmapMemoryCacheParamsSupplier = ((Supplier)Preconditions.checkNotNull(paramSupplier));
      return this;
    }

    public Builder setBitmapsConfig(Bitmap.Config paramConfig)
    {
      this.mBitmapConfig = paramConfig;
      return this;
    }

    public Builder setCacheKeyFactory(CacheKeyFactory paramCacheKeyFactory)
    {
      this.mCacheKeyFactory = paramCacheKeyFactory;
      return this;
    }

    public Builder setDecodeMemoryFileEnabled(boolean paramBoolean)
    {
      this.mDecodeMemoryFileEnabled = paramBoolean;
      return this;
    }

    @Deprecated
    public Builder setDiskStorageFactory(DiskStorageFactory paramDiskStorageFactory)
    {
      setFileCacheFactory(new DiskStorageCacheFactory(paramDiskStorageFactory));
      return this;
    }

    public Builder setDownsampleEnabled(boolean paramBoolean)
    {
      this.mDownsampleEnabled = paramBoolean;
      return this;
    }

    public Builder setEncodedMemoryCacheParamsSupplier(Supplier<MemoryCacheParams> paramSupplier)
    {
      this.mEncodedMemoryCacheParamsSupplier = ((Supplier)Preconditions.checkNotNull(paramSupplier));
      return this;
    }

    public Builder setExecutorSupplier(ExecutorSupplier paramExecutorSupplier)
    {
      this.mExecutorSupplier = paramExecutorSupplier;
      return this;
    }

    public Builder setFileCacheFactory(FileCacheFactory paramFileCacheFactory)
    {
      this.mFileCacheFactory = paramFileCacheFactory;
      return this;
    }

    public Builder setImageCacheStatsTracker(ImageCacheStatsTracker paramImageCacheStatsTracker)
    {
      this.mImageCacheStatsTracker = paramImageCacheStatsTracker;
      return this;
    }

    public Builder setImageDecoder(ImageDecoder paramImageDecoder)
    {
      this.mImageDecoder = paramImageDecoder;
      return this;
    }

    public Builder setIsPrefetchEnabledSupplier(Supplier<Boolean> paramSupplier)
    {
      this.mIsPrefetchEnabledSupplier = paramSupplier;
      return this;
    }

    public Builder setMainDiskCacheConfig(DiskCacheConfig paramDiskCacheConfig)
    {
      this.mMainDiskCacheConfig = paramDiskCacheConfig;
      return this;
    }

    public Builder setMemoryTrimmableRegistry(MemoryTrimmableRegistry paramMemoryTrimmableRegistry)
    {
      this.mMemoryTrimmableRegistry = paramMemoryTrimmableRegistry;
      return this;
    }

    public Builder setNetworkFetcher(NetworkFetcher paramNetworkFetcher)
    {
      this.mNetworkFetcher = paramNetworkFetcher;
      return this;
    }

    public Builder setPlatformBitmapFactory(PlatformBitmapFactory paramPlatformBitmapFactory)
    {
      this.mPlatformBitmapFactory = paramPlatformBitmapFactory;
      return this;
    }

    public Builder setPoolFactory(PoolFactory paramPoolFactory)
    {
      this.mPoolFactory = paramPoolFactory;
      return this;
    }

    public Builder setProgressiveJpegConfig(ProgressiveJpegConfig paramProgressiveJpegConfig)
    {
      this.mProgressiveJpegConfig = paramProgressiveJpegConfig;
      return this;
    }

    public Builder setRequestListeners(Set<RequestListener> paramSet)
    {
      this.mRequestListeners = paramSet;
      return this;
    }

    public Builder setResizeAndRotateEnabledForNetwork(boolean paramBoolean)
    {
      this.mResizeAndRotateEnabledForNetwork = paramBoolean;
      return this;
    }

    public Builder setSmallImageDiskCacheConfig(DiskCacheConfig paramDiskCacheConfig)
    {
      this.mSmallImageDiskCacheConfig = paramDiskCacheConfig;
      return this;
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.facebook.imagepipeline.core.ImagePipelineConfig
 * JD-Core Version:    0.6.2
 */